{include file="public/head"/}
<style>
    body {
        background-color: #ffffff;
    }
</style>

<body>
    <blockquote class="layui-elem-quote">
        1、《控/方》：意思是 控制器/方法; 例如 Sys/sysList<br />
        2、图标字体为上方导航栏目的图标样式,可复制图标字体样式
    </blockquote>
    <div class="layui-form layuimini-form">


        <div class="layui-form-item">
            <label class="layui-form-label">菜单类别</label>
            <div class="layui-input-inline">
                <select name="pid" lay-verify="required" lay-search="">
                    <option value="0">默认顶级</option>
                    {volist name="$menus" id="vo"}
                    <option value="{$vo.id}">{$vo.lefthtml}{$vo.title}</option>
                    {/volist}
                </select>
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label required">菜单名称</label>
            <div class="layui-input-block">
                <input type="text" name="title" lay-verify="required" lay-reqtext="菜单名称不能为空" placeholder="请输入菜单名称"
                    value="" class="layui-input">
                <!-- <tip>填写自己管理账号的名称。</tip> -->
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">控制器/方法</label>
            <div class="layui-input-inline">
                <input type="text" name="href" placeholder="请输入控制器/方法" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">菜单图标</label>
            <div class="layui-input-block">
                <input type="text" name="icon" lay-verify="required" lay-reqtext="菜单图标不能为空" placeholder="请输入菜单图标"
                    value="" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">链接打开方式</label>
            <div class="layui-input-block">
                <input type="radio" name="target" value="_self" title="系统内" checked="">
                <input type="radio" name="target" value="_block" title="新窗口">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="number" name="sort" placeholder="请输入排序" value="0" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">是否显示</label>
            <div class="layui-input-block">
                <input type="radio" name="status" value="1" title="显示" checked="">
                <input type="radio" name="status" value="0" title="隐藏">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
            </div>
        </div>
    </div>
    <script>
        layui.use(['form'], function () {
            var form = layui.form,
                layer = layui.layer,
                $ = layui.$;

            //监听提交
            form.on('submit(saveBtn)', function (data) {

                $.post('', data.field, function (res) {
                    if (res.code > 0) {
                        layer.msg(res.msg, { time: 1800, icon: 1 }, function () {
                            var iframeIndex = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(iframeIndex);
                        });
                    } else {
                        layer.msg(res.msg, { time: 1800, icon: 2 });
                    }
                });
                return false;
            });

        });
    </script>
    {include file="public/footer"/}